package com.itstack.springframework.test.bean;

import java.util.HashMap;
import java.util.Map;

/**
 * ClassName:
 * Description: TODO
 *
 * @author: Guo Shuai
 * @version: 1.0
 * @Date: 2021\11\24 0024
 */
public class UserService {

    private String name;

    public UserService() {
    }

    public UserService(String name) {
        this.name = name;
    }

    private static final Map<Long, String> userList = new HashMap<Long, String>(3);

    static {
        userList.put(1L, "小明");
        userList.put(2L, "小王");
        userList.put(3L, "小张");
    }

    public String findById(Long id) {
        return userList.get(id);
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("");
        sb.append(name);
        return sb.toString();
    }
}
